# This file is part of crest.
# SPDX-Identifier: LGPL-3.0-or-later
#
# crest is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# crest is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with crest.  If not, see <https://www.gnu.org/licenses/>.

asciidoctor = find_program('asciidoctor', required: false)
if asciidoctor.found()
  foreach man_name : ['crest.adoc']
    install_man(
      configure_file(
        input: files(man_name),
        output: '@BASENAME@.1',
        command: [
          asciidoctor,
          '--attribute=release-version=@0@'.format(meson.project_version()),
          '--backend=manpage',
          '--out-file=@OUTPUT@',
          '@INPUT@',
        ],
      )
    )
  endforeach
endif
